import util from 'node:util'

class Logger {
  constructor(module) {
    this.module = module
  }

  debug(...args) {
    const prefix = this.module ? this.module + ' ' : ''
    const content = prefix + util.format(...args) + '\n'
    return process.stderr.write(content)
  }

  info(...args) {
    const prefix = this.module ? this.module + ' ' : ''
    const content = prefix + util.format(...args) + '\n'
    return process.stderr.write(content)
  }
}

export default new Logger()
